********************************************************************************
* 							 CIVILIAN POLLS DATA							   *
********************************************************************************

clear all
set more off
set scheme plotplainblind
macro drop _all
est drop _all
set matsize 800
set seed 8675309

** Set Working Directory

if c(username) == "christopherblair"{
global dir "~/Desktop/JOP Replication"
global raw "${dir}/Raw Files"
global code "${dir}/Code"
global result "${dir}/Results"
global poll "${dir}/Gallup Polls"										
}

else if c(username) == "youruser"{
global dir "~/Desktop/JOP Replication"
global raw "${dir}/Raw Files"
global code "${dir}/Code"
global result "${dir}/Results"
global poll "${dir}/Gallup Polls"	
}

********************************************************************************

eststo clear

** September 1944

use "${poll}/1944 - September/USAIPO1944-0329.dta"

gen cw_japan=(Q2AP==1)
replace cw_japan=. if Q2AP==.c
replace cw_japan=. if Q2AP==.a
label var cw_japan "Approve CW Use Against Japanese Cities to Expedite War End: Yes"

gen cw_germany=(Q2BP==1)
replace cw_germany=. if Q2BP==.c
replace cw_germany=. if Q2BP==.a
label var cw_germany "Approve CW Use Against German Cities to Expedite War End: Yes"

gen all=1

eststo: reg cw_japan all [pw= WtPubEd], cluster(state) nocons
eststo: reg cw_germany all [pw= WtPubEd], cluster(state) nocons

** December 1944

use "${poll}/1944 - December/USAIPO1944-0337.dta", clear

gen cw_japan=(Q1==1)
replace cw_japan=. if Q1==.c
replace cw_japan=. if Q1==.a
label var cw_japan "Approve CW Use Against Japanese Cities in Retaliation for Killing Bomber Pilots: Yes"

gen all=1

eststo: reg cw_japan all [pw= WtPubEd], cluster(state) nocons

** March 1945

use "${poll}/1945 - March/USAIPO1945-0343.dta", clear

gen cw_japan_k=(Q2K==1)
replace cw_japan_k=. if Q2K==.c
replace cw_japan_k=. if Q2K==.a
label var cw_japan_k "Approve CW Use Against Japanese Soldiers to Expedite War End: Yes"

gen cw_japan_t=(Q2AT==1)
replace cw_japan_t=. if Q2AT==.c
replace cw_japan_t=. if Q2AT==.a
label var cw_japan_t "Approve CW Use Against Japanese Soldiers: Yes"

gen cw_japan_t_retaliatory=(Q2BT==7)
replace cw_japan_t_retaliatory=. if Q2BT==.c
replace cw_japan_t_retaliatory=. if Q2BT==.a
replace cw_japan_t_retaliatory=. if Q2AT!=1
label var cw_japan_t_retaliatory "US Should Use CW Against Japanese Soldiers: Only if they Use First"

gen cw_japan=cw_japan_k
replace cw_japan=cw_japan_t if form==2

gen all=1

eststo: reg cw_japan all [pw= WtPubEd] if form==1, cluster(state) nocons

eststo: reg cw_japan all [pw= WtPubEd] if form==2, cluster(state) nocons


** May 1945

use "${poll}/1945 - May/USAIPO1945-0347.dta", clear

gen cw_japan=(Q9K==1)
replace cw_japan=. if Q9K==.c
replace cw_japan=. if Q9K==.a
label var cw_japan "Approve CW Use Against Japanese Soldiers to Expedite War End: Yes"

gen all=1

eststo: reg cw_japan all [pw= WtPubEd], cluster(state) nocons

** June 1945

use "${poll}/1945 - June/USAIPO1945-0349.dta", clear

gen cw_japan_k=(Q3AK==1)
replace cw_japan_k=. if Q3AK==.c
replace cw_japan_k=. if Q3AK==.a
label var cw_japan_k "Approve CW Use Against Japanese to Reduce US Casualties: Yes"

gen cw_japan_t=(Q3AT==1)
replace cw_japan_t=. if Q3AT==.c
replace cw_japan_t=. if Q3AT==.a
label var cw_japan_t "Approve CW Use Against Japanese to Reduce US Casualties: Yes"

gen cw_japan=cw_japan_k
replace cw_japan=cw_japan_t if form==2

gen all=1

eststo: reg cw_japan all [pw= WtPubEd] if form==1, cluster(state) nocons

eststo: reg cw_japan all [pw= WtPubEd] if form==2, cluster(state) nocons

eststo: reg cw_japan all [pw= WtPubEd], cluster(state) nocons


********************************************************************************

coefplot (est1, msym(O) mfcolor(white) mlcolor(black) msize(large) ciopts(lwidth(.5 1.15) lcolor(black black))) (est3, msym(D) mfcolor(white) mlcolor(black) msize(large) ciopts(lwidth(.5 1.15) lcolor(black black))) (est4, msym(O) mfcolor(red) mlcolor(red) msize(large) ciopts(lwidth(.5 1.15) lcolor(red red))) (est5, msym(S) mfcolor(red) mlcolor(red) msize(large) ciopts(lwidth(.5 1.15) lcolor(red red))) (est6, msym(O) mfcolor(red) mlcolor(red) msize(large) ciopts(lwidth(.5 1.15) lcolor(red red))) (est9, msym(O) mfcolor(red) mlcolor(red) msize(large) ciopts(lwidth(.5 1.15) lcolor(red red))), vert ylabel(.1(.05).5) ymtick(.1(.01).5) legend(off) ytitle("Average Civilian Support for Using" "Chemical Weapons Against Japan") title(" ") xline(.71375, lpatt(solid) lcolor(gs10)) xlabel(.6425 `""September" "1944""' .785 `""December" "1944""' .9277 `""March" "1945""' 1.0686 `" "March" "1945""' 1.213 `""May" "1945""' 1.356`""June" "1945""') text(.2384135 .6 ".238", size(small)) text(.4625267 .74 ".463", size(small)) text(.3902589 .89 ".390", size(small)) text(.3186496 1.03 ".319", size(small)) text(.3189123 1.18 ".319", size(small)) text(.4159115  1.32 ".416", size(small)) text(.5 .68 `"S-175"', size(small)) ci(95 90)

graph export "${result}/gallup_cw.png", replace


********************************************************************************

eststo clear

** September 1944

use "${poll}/1944 - September/USAIPO1944-0329.dta", clear

gen cw_japan=(Q2AP==1)
replace cw_japan=. if Q2AP==.c
replace cw_japan=. if Q2AP==.a
label var cw_japan "Approve CW Use Against Japanese Cities to Expedite War End: Yes"

gen cw_germany=(Q2BP==1)
replace cw_germany=. if Q2BP==.c
replace cw_germany=. if Q2BP==.a
label var cw_germany "Approve CW Use Against German Cities to Expedite War End: Yes"

gen all=1

eststo: reg cw_japan black [pw= WtPubEd], cluster(state)

** December 1944

use "${poll}/1944 - December/USAIPO1944-0337.dta", clear

gen cw_japan=(Q1==1)
replace cw_japan=. if Q1==.c
replace cw_japan=. if Q1==.a
label var cw_japan "Approve CW Use Against Japanese Cities in Retaliation for Killing Bomber Pilots: Yes"

gen all=1

eststo: reg cw_japan black [pw= WtPubEd], cluster(state)

** March 1945

use "${poll}/1945 - March/USAIPO1945-0343.dta", clear

gen cw_japan_k=(Q2K==1)
replace cw_japan_k=. if Q2K==.c
replace cw_japan_k=. if Q2K==.a
label var cw_japan_k "Approve CW Use Against Japanese Soldiers to Expedite War End: Yes"

gen cw_japan_t=(Q2AT==1)
replace cw_japan_t=. if Q2AT==.c
replace cw_japan_t=. if Q2AT==.a
label var cw_japan_t "Approve CW Use Against Japanese Soldiers: Yes"

gen cw_japan_t_retaliatory=(Q2BT==7)
replace cw_japan_t_retaliatory=. if Q2BT==.c
replace cw_japan_t_retaliatory=. if Q2BT==.a
replace cw_japan_t_retaliatory=. if Q2AT!=1
label var cw_japan_t_retaliatory "US Should Use CW Against Japanese Soldiers: Only if they Use First"

gen cw_japan=cw_japan_k
replace cw_japan=cw_japan_t if form==2

gen all=1

eststo: reg cw_japan black [pw= WtPubEd] if form==1, cluster(state)

eststo: reg cw_japan black [pw= WtPubEd] if form==2, cluster(state)


** May 1945

use "${poll}/1945 - May/USAIPO1945-0347.dta", clear

gen cw_japan=(Q9K==1)
replace cw_japan=. if Q9K==.c
replace cw_japan=. if Q9K==.a
label var cw_japan "Approve CW Use Against Japanese Soldiers to Expedite War End: Yes"

gen all=1

eststo: reg cw_japan black [pw= WtPubEd], cluster(state)


** June 1945

use "${poll}/1945 - June/USAIPO1945-0349.dta", clear

gen cw_japan_k=(Q3AK==1)
replace cw_japan_k=. if Q3AK==.c
replace cw_japan_k=. if Q3AK==.a
label var cw_japan_k "Approve CW Use Against Japanese to Reduce US Casualties: Yes"

gen cw_japan_t=(Q3AT==1)
replace cw_japan_t=. if Q3AT==.c
replace cw_japan_t=. if Q3AT==.a
label var cw_japan_t "Approve CW Use Against Japanese to Reduce US Casualties: Yes"

gen cw_japan=cw_japan_k
replace cw_japan=cw_japan_t if form==2

gen all=1

eststo: reg cw_japan black [pw= WtPubEd] if form==1, cluster(state)

eststo: reg cw_japan black [pw= WtPubEd] if form==2, cluster(state)

eststo: reg cw_japan black [pw= WtPubEd], cluster(state)


********************************************************************************

coefplot (est1, msym(O) mfcolor(white) mlcolor(black) msize(large) ciopts(lwidth(.5 1.15) lcolor(black black))) (est2, msym(D) mfcolor(white) mlcolor(black) msize(large) ciopts(lwidth(.5 1.15) lcolor(black black))) (est3, msym(O) mfcolor(red) mlcolor(red) msize(large) ciopts(lwidth(.5 1.15) lcolor(red red))) (est4, msym(S) mfcolor(red) mlcolor(red) msize(large) ciopts(lwidth(.5 1.15) lcolor(red red))) (est5, msym(O) mfcolor(red) mlcolor(red) msize(large) ciopts(lwidth(.5 1.15) lcolor(red red))) (est8, msym(O) mfcolor(red) mlcolor(red) msize(large) ciopts(lwidth(.5 1.15) lcolor(red red))), vert keep(black) ci(95 90) ylabel(-.15(.05).35) ymtick(-.15(.01).35) legend(off) yline(0, lpatt(shortdash) lcolor(navy)) xline(.71375, lpatt(solid) lcolor(gs10)) yline(-.15, lpatt(dot) lcolor(gs10)) yline(.35, lpatt(dot) lcolor(gs10)) ytitle("Racial Gap in" "Average Civilian Support for Using" "Chemical Weapons Against Japan") title(" ") xlabel(.6425 `""September" "1944""' .785 `""December" "1944""' .9277 `""March" "1945""' 1.0686 `" "March" "1945""' 1.213 `""May" "1945""' 1.356`""June" "1945""') text(.025 .59 ".018", size(small)) text(.098 .741 ".085", size(small)) text(.14 .88 ".135", size(small)) text(.07 1.02 ".063", size(small)) text(.19 1.17 ".180", size(small)) text(.07  1.31 ".066", size(small)) text(.35 .75 `"S-175"', size(small))

graph export "${result}/gallup_cw_black.png", replace

********************************************************************************

clear all
